<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script>


  async function test(){
    await new Promise((resolve, reject)=>{
      setTimeout((flag)=>{
        if(flag){
          resolve("第一次请求成功")
        }else {
          reject("第一次请求失败")
        }
      },2000,true)
    })
    console.log("async inner")
  }


  (async function (){
    await test()
    console.log("async outer")
  })()





</script>
</html>